<template>
  <div class="form-layout">
    <!--左侧导航-->
    <div class="nav-left">
      <customAnchor :itemList="[{ name: 'box-base', title: '基础信息'}, {name: 'box-info', title: '业务信息'}]" />
    </div>
    <!--表单区域-->
    <div class="form-right" ref="formRight">
      <customForm :data="form" :rules="propRules" ref="editForm" :disabled="propReadonly">
        <template #content>
          <div id="box-base" class="box-title">基础信息</div>
          <customFormItem label="场景标识" name="sceneCode" :parent="_self" :form="form" />
          <customFormItem label="消息类型" name="msgType" :parent="_self" :form="form"
                          :type="constCommon.formItemType.selectDict.name"
                          :config="{dictType: constCommon.dictType.msgType}"
          />

          <customFormItem label="消息标题" name="title" :parent="_self" :form="form" />

          <customFormItem label="接收者账号" name="receiver" :parent="_self" :form="form" />
          <customFormItem label="是否成功" name="isSuccess" :parent="_self" :form="form"
                          :type="constCommon.formItemType.switch.name"/>
          <customFormItem label="消息内容" name="content"
                          :type="constCommon.formItemType.staticHtml.name"
                          fullWidth
                          heightAuto
                          :parent="_self" :form="form" />


          <div id="box-info" class="box-title">业务信息</div>
          <customFormItem label="业务主键" name="bizKey" :parent="_self" :form="form" />
          <customFormItem label="业务类型" name="bizType" :parent="_self" :form="form" />
          <customFormItem label="消息参数" name="params"
                          :type="constCommon.formItemType.staticHtml.name"
                          fullWidth
                          heightAuto
                          :parent="_self" :form="form" />

          <customFormItem label="异常消息"
                          name="exceptionMsg"
                          :type="constCommon.formItemType.staticHtml.name"
                          fullWidth
                          heightAuto
                          :parent="_self" :form="form" />

        </template>
      </customForm>
    </div>
  </div>
</template>

<script>
import customAnchor from '@/components/custom/form/customAnchor.vue'

export default {
  help: '推送记录-详情',
  data() {
    return {
      form: {},
      viewData: {},
    }
  },
  methods: {
  },
  created() {
    this.$emit('event-register', {
      validate: (callback) => {
        return this.$refs.editForm.validate(callback)
      },
      beforeSave: () => {
        this.$emit('data-callback', this.form)
        return true
      },
      afterMove: (formData) => {
        this.form = global.utils.jsonClone(formData)
        this.viewData = this.propCurrentRow

      },
      afterSave: () => {
      },
      beforeDelete: () => {
        return true
      },
      afterDelete: () => {
      },
      beforeFlow: (flowButtonKey) => {
        return true
      },
      afterFlow: (flowButtonKey) => {
      },
      beforeClose: () => {
        return true
      },
    })
  },
  props: {
    propParent: Object,
    propInitData: Object,
    propPrimaryKey: String,
    propDictionaries: Object,
    propCurrentRow: Object,
    propViewFormData: Object,
    propReadonly: Boolean,
    propStatus: String,
    propRules: Object,
  },
  components: { customAnchor },
  computed: {},
}
</script>
